package votes

import (
	"context"
	"gitee.com/shijun123456/srpcinterface/client"
	"gitee.com/shijun123456/srpcinterface/client/votes"
)

type (
	ArgsGetPayInfo = votes.ArgsGetPayInfo
	ReplyGetPayinfo = votes.ReplyGetPayinfo
	Xindaluer interface {
		GetInfo(context.Context, *ArgsGetPayInfo) (*ReplyGetPayinfo, error)
	}
)
//默认用户的客户端
type Xindalu struct {
	c           client.Client
	servicename string //服务的名称信息
	servicepath string //服务path 信息 服务信息 call path/method
	client votes.PaySvcClient
}
func (f *Xindalu) Init() *Xindalu {
	f.servicepath = "VoteService"
	f.servicename = "vote.svc"
	f.c.Init(f) //初始化信息
	f.client = votes.NewPaySvcClient(f.c.Conn())
	return f
}
func (x *Xindalu) GetInfo(ctx context.Context, info *ArgsGetPayInfo) (*ReplyGetPayinfo, error) {
	return x.client.GetInfo(ctx,info)
}
//接口信息
func (f *Xindalu) GetServiceName() string {
	return f.servicename
}
func (f *Xindalu) Close() {
	f.c.PutConn(f.c.Conn())
	f.c.PoolClose()
	f.c.Conn().Close()
}

